<?php

// Get variables

$files = v('files');
?>

<!-- breadcrump -->

<ul class="breadcrumb">
	<li class="active">List of files</li>
</ul>

<br />


<!-- -->
<div class="tabbable">
	<ul class="nav nav-tabs" id="myTab">
		<?php
		$cpt =0;

		foreach ($files as $extensionId => $directories)
		{
		?>		
			<li <?php if($cpt ==0) { ?> class="active" <?php } ?>>
				<a href="#<?php p($extensionId); ?>" data-toggle="tab"><?php p($extensionId); ?></a>
			</li>
		<?php
			$cpt++;
		}
		?>
	</ul>
</div>


<div class="tab-content">
<?php
	$cpt=0;

	foreach ($files as $extensionId => $directories)
	{
?>
		<div class="tab-pane <?php if($cpt ==0) { ?>active<?php } ?>" id="<?php p($extensionId); ?>">
			<?php
					foreach ($directories as $directory => $listFiles)
					{
			?>

						<h4 style="text-align: center;">
							<?php p($directory); ?>
						</h4>
						<div>
							<table class="table table-hover table-bordered">
								<thead>
								    <tr>
								      <th>Name</th>
								    </tr>
								</thead>
								<tbody>

								<?php
									foreach ($listFiles as $fileName => $apis)
									{
										if (count($apis) > 0)
										{
								?>
											<tr>
												<td>
													<a href="<?php p(url('[Loop]/page/admin/sandbox/list/') . '?extensionId=' . $extensionId .'&directory=' . $directory . '&fileName=' . $fileName);?>">
																<?php p($fileName); ?>
													</a>
												</td>
											<tr>
								<?php
										}
									}
								?>
								</tbody>
							</table>
						</div>

			<?php
					}
			?>
		</div>
<?php
		$cpt++;
	}
?>
</div>